package com.hdwe.tools.pm.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.hdwe.tools.pm.domain.PmProject;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.constant.CacheNames;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;



/**
 * 项目视图对象 pm_project
 *
 * @author s
 * @date 2024-12-10
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = PmProject.class)
public class PmProjectVo extends BaseEntityVO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long id;

    /**
     * 项目编号
     */
    @ExcelProperty(value = "项目编号")
    private String projectCode;

    /**
     * 项目名
     */
    @ExcelProperty(value = "项目名")
    private String projectName;

    /**
     * 负责人
     */
    @ExcelProperty(value = "负责人")
    private Long owner;

    /**
     * 任务负责人名称
     */
    @TableField(exist = false)
//    @Translation(type = TransConstant.USER_ID_TO_NAME, mapper = "owner")
    @Translation(type = TransConstant.COMBOBOX_KEY_TO_LABEL, mapper = "owner", other = CacheNames.COMBOBOX_USER)
    private String ownerName;

    /**
     * 排序
     */
    @ExcelProperty(value = "排序")
    private Long projectSort;

    /**
     * 关联人员
     */
    @ExcelProperty(value = "关联人员")
    private String relatedUsers;

    /**
     * 样式
     */
    private String classStyle;

    /**
     * 状态（enable正常 disable停用）
     */
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=nable正常,d=isable停用")
    private String status;

    /**
     * 创建部门
     */
    @ExcelProperty(value = "创建部门")
    private Long createDept;

    /**
     * 创建者
     */
    @ExcelProperty(value = "创建者")
    private Long createBy;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 修改者
     */
    @ExcelProperty(value = "修改者")
    private Long updateBy;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date updateTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;


}
